﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <string.h>
#include <math.h>
#include <unordered_map>
using namespace std;

class Solution {
public:
    int majorityElement(vector<int>& nums) {
        int count = 0, num = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            if (count == 0) num = nums[i];
            if (num == nums[i]) count++;
            else count--;
        }
        return num;
    }
};

int main()
{
    return 0;
}
